package net.caidingke.shepherd.utils.result;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Getter;

/**
 * @author bowen
 * @create 2017-08-11 10:23
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
@Getter
public class Result<T> extends Response {

    private static final long serialVersionUID = 7133152428901216030L;
    private T content;

    static <T> Result<T> newInstance() {
        return new Result<>();
    }

    @Override
    public Result setStatus(int status) {
        super.setStatus(status);
        return this;
    }

    @Override
    public Result setMsg(String msg) {
        super.setMsg(msg);
        return this;
    }

    public Result setContent(T data) {
        this.content = data;
        return this;
    }

}
